
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title></title>
    <link rel="stylesheet" href="/css_system/common.css" />
    <link rel="stylesheet" href="/css_system/main.css" />
    <link href="/js_system/jQueryUI/jquery-ui.css" rel="stylesheet">
    <link rel="stylesheet" href="/js_system/easydialog/easydialog.css" />
    <script type="text/javascript" src="/js_system/easydialog/easydialog.js"></script>
    <script type="text/javascript" src="/js_system/cueeasy.js"></script>
    <script type="text/javascript" src="/js_system/jquery.min.js"></script>
    <script type="text/javascript" src="/js_system/common.js"></script>
    <script type="text/javascript" src="/js_system/member.js"></script>
    <!-- 表格 -->
    <script type="text/javascript" src="/js_system/colResizable-1.3.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $(".dataTable").colResizable({
                liveDrag: true,
                gripInnerHtml: "<div class='grip'></div>",
                draggingClass: "dragging",
                minWidth: 30
            });

        });
    </script>
</head>
<body>
<div class="container">
    <form action="{{asset('admin_system/member/select_member_list')}}" method="get">
        <dl class="filter clearfix">
            <dt>查询关键词：</dt>
            <dd>
                <input type="text" value="{{$keyword}}" onkeydown="if(event.keyCode==13){document.getElementById('SearchBtn').click();return false;}" class="input-text" id="KeyWords" name="keywords">
            </dd>

            <dd>
                <select name="memberType"  class="select" id="memberType">
                    <option value="2" @if($memberType == 2) selected @endif>全部</option>
                    <option value="1" @if($memberType == 1) selected @endif>已激活</option>
                    <option value="0" @if($memberType == 0) selected @endif>未激活</option>
                </select>
            </dd>
            <dd>
                <input type="hidden" value="{{$registerType}}" id="registerType" name="registerType">
                <input type="hidden" value="{{$companyId}}" name="companyId">
            </dd>
            <dd>
                <input type="submit" class="button button-primary" id="SearchBtn" value="搜 索">
            </dd>
        </dl>
    </form>


    <table class="dataTable">
        <thead>
        <tr>
            <th>姓名</th>
            <th>会员账号</th>
            <th>状态</th>
            <th>选择 </th>
        </tr>
        </thead>
        <tbody>
        @foreach($entMemberInfo as $data)
            <tr>
                <td>{{$data->YourName}}</td>
                <td class="text-left">{{$data->UserName}}</td>
                <td>@if($data->States==0)未激活@else已激活 @endif</td>
                <td>
                    <label style="background:#ccc;padding:5px;">
                        <input type="checkbox"
                               name="cbxid"
                               value="{{$data->UserID}}"
                               id="cbxid_{{$data->UserID}}"
                               onchange="change_member('{{$data->UserID}}','{{$data->YourName}}')"
                            >
                    </label>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>

    <div class="pagectrl clearfix">
        {!! $entMemberInfo->appends(['search'=>'m','memberType'=>$memberType,'registerType'=>$registerType,'companyId'=>$companyId])->links() !!}
    </div>
</div>
</body>
</html>


<script>

    function change_member(id,name){
        var checked = $(event.currentTarget).prop('checked');
            if(checked){
                window.parent.add_member({id:id,name:name});
            }else{
                window.parent.delete_member(id);
            }
    }


</script>